The present invention relates to main storage management processes for a computer system using a virtual storage.
In a conventional computer using a virtual storage type operating system, a demand paging system is known as a main storage management system. More specifically, as described in HITAC Manual "VOS3/ES Center Managed -JSS3 Vol. 3-" (1987), pp. 58-80, or P. B. Hansen: "Operating System Principles", Prentice-Hall (1973), pp. 176-182 and 213-224, the main storage management system includes both paging and swapping processes.
The paging process maintains, in executable form, a job executed by a CPU while allocating to the job a real storage area which the job requires. It dynamically allocates and releases (deallocates) pages of a real storage to and from a virtual page which is a fixed length unit of a virtual storage. The time interval from the time when each of real pages allocated to a virtual page is referred to last to the current time (unreferenced time interval) is measured. When a shortage of real pages not already allocated to virtual pages occurs, the real pages are released in order of unreferenced time intervals.
The swapping process is used, on the other hand, to reserve further execution of a job under execution, to save the contents of a real storage allocated to the job in an auxiliary storage in order to release the area in the real storage (swap out), and then to load in the real storage all the saved contents when the job is recovered to a re-executable state (swap in). Paging is effected for each page in the real storage while swapping is effected for all pages which a program, for example, a job, is using.
In the conventional technique, if the capacity of the real storage area which a job to be swapped occupies is large, a quantity of transfer of data or a program deriving from swapping between the real storage and an auxiliary storage becomes large. These are overhead (unnecessary) operations for execution of programs by the computer. Therefore, a portion of time for which a central processing unit (CPU) and an input/output (I/O) device are used for purposes other than execution of programs increases in proportion to the quantity of real storage. Thus, a state is brought about that the job under execution is likely to wait for the CPU and I/O, and the processing efficiency and responsiveness of the system decreases. This state is called a slashed state. If paging is employed to solve a shortage of the real storage, paging occurs frequently because large-scaled jobs being executed compete with each other with respect to the real storage. Thus a slashed state is brought about disadvantageously as in the swapping of the large-scale job.
Japanese Patent Publication JP-A 60-54058 discloses a process for swapping a job with a reduced overhead. A swapping operation of a job which performs transactions is executed when the job completes one of the transactions and then enters into a waiting state. What is saved in the auxiliary storage is a program area (including not only an area for program instructions but also data buffer area designated by a user). The contents of work areas which the system has allocated to the program are not required for the subsequent transaction to be executed by the job, so they are not saved to the auxiliary storage but, rather, are released.
The above-mentioned prior art reduces an overhead on swapping by not saving data in work areas which are not to be used later by the job. The program area containing programs and data used later are all saved (swapped out), so the overhead due to the swapping is still large for a large scale job.
A multiple virtual storage system is also known in which each of the jobs can access a plurality of virtual storage spaces. Such a system has other problems with paging and swapping.
A computer system using such a paging type multiple virtual storage process is described, for example, in IBM Manual SA22-7200-0, "IBM Enterprise System Architecture/370 Principles of Operation", pp. 3-1 to 3-47, 5-26 to 5049 (Aug. 1988).
Specifically, as shown in FIG. 2 a virtual storage 100, a real storage 103, and an auxiliary storage 104 are each divided into units of a fixed length referred to as pages. A real page 108 and an auxiliary page 109 are allocated for each of virtual pages 106 and 107. For example, a j-th real page 108 and a k-th auxiliary page 109 are allocated to an i-th virtual page 106. The correspondence between these pages is provided by a conventional address converter (not shown). The virtual storage spaces include an address (data) space capable of accommodating both programs and data and data spaces each capable of accommodating only data. One job is capable o using one address space 101 and a plurality of data spaces 102. As shown in FIG. 3, the system includes a group of 16 space registers, designated generally by 201, which hold space identifiers, each indicative of one of virtual storage spaces to which belongs the address stored in each of a group of 16 general-purpose registers #0-#15 designated generally by 200. A reference bit storage 4 (FIG. 2) holds a reference bit corresponding to each real page, indicative of whether or not the corresponding real page has been referred to. FIG. 3 schematically shows the relationship between the contents of the group of general purpose registers 200, the group of space registers 201, and the spaces in the virtual storage. In FIG. 3, it is assumed that general purpose registers #1 and #2 have addresses in address space 101 in virtual storage 100 while general-purpose registers #3 and #15 each have addresses in one (102A or 102B) of data spaces 102 in virtual storage 100 and that the corresponding space registers #1, #2, #3 and #15 hold space identifiers o, 0, 3 and 1 of address space 101, address space 101, data space 102A and data space 102B, respectively. When a central processing unit (CPU) is taken away from the job under execution, the contents of each of the space registers 201, are saved in a space register saving area 211 in a job control table (JCT) 210 provided on real storage 103 and corresponding to the job. When the job is assigned to the CPU later on and the execution of the job is restarted, the saved data is again loaded in the group of space registers 201. The job control table 210 further includes a pair of address space identifier 214A and a real page pointer 213 indicative of the head of a list of real pages allocated to that address space, and plural pairs each of space identifier 212D of one data space and real pointer 213 indicative of the head of a list of real pages allocated to that data space. Reference numeral 214 denotes a pointer of a list of swapped-in jobs (in-job list) and a point of a list of swapped-out jobs (out-job list).
When pages allocated to a job are to be paged out in the prior art, contents of a virtual page having a longer unreferenced time interval are paged out irrespective of the virtual storage space (address space 101, data space 102) to which the job belongs. A real page allocated to a virtual page in a virtual storage space whose space identifier was stored in one of the space registers 201 often has a high probability that it will be used earlier than the real pages allocated to virtual pages in other virtual spaces among the virtual spaces used by the job.
However, if the unreferenced time for a real page having a high probability of earlier use is longer than that for a real page having a lower probability of earlier use, the former rather than the latter would undesirably be paged out.
Therefore, a paging process is desirable which reflects the degree of probability of earlier use of a real page.
Furthermore, in the above prior art, when a job is to be swapped in, real pages which were allocated to virtual pages are "swapped in" in an order of virtual spaces to which the virtual pages belong. The order of the virtual spaces is determined in accordance with a predetermined order of space identifiers. Generally, contents of the real page which were allocated to a virtual page belonging to a virtual storage whose space identifier was held in space register 201 when the job under execution directly before the job was swapped out often has a high probability that those contents will be used earlier than those of the real pages which were allocated to virtual pages in other virtual storage spaces among the virtual storage spaces the job used before.
However, in the above conventional process, if the identifier of a virtual space for a real page having a lower probability of earlier use precedes the identifier of a virtual space for a real page having a higher probability of earlier use within the predetermined order of the space identifiers, the contents of the former real page can be swapped in earlier than the contents of the latter real page. If the job is assigned the CPU and starts to be executed after start of swapping in of the job and before contents of all virtual pages in all the virtual storage spaces which were allocated to the job has been swapped in, it can occur that contents of real pages are swapped in yet correspond when a space identifier is reloaded in space register 201 for a virtual storage space to which the real pages are allocated. Thus, a fault interruption of a virtual storage occurs and execution of the job is delayed. Therefore, swapping which reflects the degree of probability of earlier use of a real page is desirable.